<?
	Class Acl extends Base {
	
		function __call($method,$arguments) {
			if(is_array($arguments)&&is_array($this->$method)) {
				if(array_intersect($arguments, $this->$method)) return true;
				else {
					foreach($this->$method as $meth) if(strpos($meth,'*')!==false) {
						$contrAction = explode('/',$meth);
						foreach((array)$arguments as $argument) {
							$contrActionArg = explode('/',$argument);
							if($contrAction[0]=='*'&&$contrAction[1]==$contrActionArg[1]) return true;
							elseif($contrAction[1]=='*'&&$contrAction[0]==$contrActionArg[0]) return true;
							elseif($contrAction[0]=='*'&&$contrAction[1]=='*') return true;
						}
					}
				}
			}
			return false;
		}

		function add($path,$type) {
			if(!is_array($this->$type)) $this->$type=array();
			$this->$type = array_merge($this->$type,array_map('trim',(array)$path));
		}

		
		
	}
?>
